import request from "@/utils/request";

// 生成支付二维码
export function qrcode(userId, totalPrice) {
    const data = {
        userId, totalPrice
    }
    return request({
        url: "/order/qrcode/",
        method: 'post',
        data: data
    })
}

// 移除支付二维码
export function removeQrcode(qrcode) {
    return request({
        url: "/order/removeQrcode/",
        method: 'post',
        data: qrcode
    })
}

// 新增订单
export function addOrder(order) {
    return request({
        url: "/order/add/",
        method: 'post',
        data: order
    })
}

// 订单数据分页
export function page(pageNum, pageSize, params) {
    const data = {
        pageNum,
        pageSize,
        params
    }
    return request({
        url: "/order/page/",
        method: 'post',
        data: data
    })
}

// 获取订单支付二维码， 已生成
export function getQrcode(orderNumber) {
    return request({
        url: "/order/getQrcode/",
        method: 'post',
        data: orderNumber
    })
}
